package com.andiary.common.database;


import android.app.Activity;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.Menu;
import android.widget.Toast;
import java.util.logging.*;
import android.util.Log;
import com.andiary.common.*;


public class InitializeDB extends Activity{
	private static Logger logger = Logger.getLogger("DBCreation");
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.showevent);
	    SQLiteDatabase diarydb = null;
    try
		{
	    diarydb = InitializeDB.this.openOrCreateDatabase("andiarydb",MODE_PRIVATE, null);
		diarydb.execSQL("CREATE TABLE IF NOT EXISTS Event (EVENT_DATE TEXT,EVENT_TITLE TEXT,EVENT_DETAIL BLOB);");
		diarydb.execSQL("INSERT INTO Event(EVENT_DATE,EVENT_TITLE,EVENT_DETAIL) VALUES ('28/11/2008','Andiary Release','Andiary release function is celebrated by Android Indians and every one enjoyed by using this diary.');");
		diarydb.execSQL("INSERT INTO Event(EVENT_DATE,EVENT_TITLE,EVENT_DETAIL) VALUES ('12/14/2008','Exhibition-FESPA Ltd & Services International'," +
				"'Wide and super-wide format digital printers Inks and substrates Colour management products and systems Digital cameras and equipment Digital imaging equipment Laminating equipment and consumables Prepress systems Presentation and display equipment Proofing equipment Mounting machines Software Printed Output.');"); 
		diarydb.execSQL("INSERT INTO Event(EVENT_DATE,EVENT_TITLE,EVENT_DETAIL) VALUES ('12/17/2008','Exhibition-KISAN Forum Pvt. Ltd','" +
				"KISAN 2008 Fair is being organized with an objective to create a single FORUM for Indian Agri community. To achieve this objective we are joining hands with like minded organizations, Government Authorities and Media in every part of India. " +
				"A Special Team is put in action to ensure presence of Policy Makers, Opinion Makers, Agri Entrepreneurs and Progressive Farmers from across India. It will be the Largest Gathering of Agri Community in India.');");

		diarydb.execSQL("INSERT INTO Event(EVENT_DATE,EVENT_TITLE,EVENT_DETAIL) VALUES ('12/19/2008','Conference, Seminar, Others','" +
				"eXample Consulting Group is conducting an immensely practical SIX SIGMA GREEN BELT CERTIFICATION weekend public workshop at MUMBAI, India on 19, 20 AND 21st DECEMBER 2008 (Fri to Sun).');");
		diarydb.execSQL("INSERT INTO Event(EVENT_DATE,EVENT_TITLE,EVENT_DETAIL) VALUES ('01/09/2009','Exhibition:Winmedia Communications Private Limited','" +
				"Automobile Manufacturers [2/3/4 Wheelers] Automotive Services, Equipment & Tools Automotive Electrical & Electronic Components Coach Builders / Custom-Built / Design Vehicles Designers / Modifiers / Tuners Environment Compliances & Initiatives " +
				"Auto Concepts, Design & Development Automobile Machinery Automobile Component Manufacturers Automobile Accessories Automotive Maintenance Equipment Automotive Interiors & Finish Products Batteries & Battery Operated Vehicles Bikes, Trikes & Quads Audio & Entertainment Systems ITeS, Cad/Cam Solutions & Navigation " +
				"Systems Media & Publishing Oil & Lubricants CNG Units Paints & Coatings Roads & Infrastructure Security & Safety Equipment Tyres, Tubes & Wheels Vehicle Care Products Garage & Workshop Equipments Insurance & Finance.');");
				
		diarydb.execSQL("INSERT INTO Event(EVENT_DATE,EVENT_TITLE,EVENT_DETAIL) VALUES ('04/17/2009','Exhibition-Consultants Firm India','" +
				"INDIA INTERNATIONAL CAREER EXHIBITION (IICE-2009) Education & Job Fair, continue to be an indispensable platform for the public and private sector employers and local and foreign education institutions offering a myriad of career and education options.');"); 
		//Toast.makeText(InitializeDB.this, "Sucessfully created..", Toast.LENGTH_LONG).show();
		}
	catch(Exception ex)
	{
		ex.getStackTrace();
		logger.info("Execption throws here ...............");
		Toast.makeText(InitializeDB.this, "DB and Table Exist!!! ", Toast.LENGTH_LONG).show();
		}
}
}
